/*
 * BUS.h
 *
 *  Created on: 2016-4-23
 *      Author: Billli
 */

#ifndef BUS_H_
#define BUS_H_
#include "system.h"
#include "io.h"

#define CPU_FREQ	100000000 	//100M


#define CS0	    0x00
#define CS1		0x01
#define CS2		0x02
#define CS3		0x03
#define CS4		0x04
#define CS5		0x05
#define CS6		0x06
#define CS7		0x07

#define BUS_WR(chipselect,offset,data)	IOWR(BUS_BASE,(chipselect<<8)|(offset&0xff),data)
#define BUS_RD(chipselect,offset)		IORD(BUS_BASE,(chipselect<<8)|(offset&0xff))

#endif /* BUS_H_ */
